/**
 * \file misc.h
 * \brief Miscellaneous functions.
 **/

#ifndef R_MISC_H
#define R_MISC_H

#include "standard.h"
#include "codes.h"

/**
 * \brief Load a file into memory (allocating the buffer, and returning its
 * size).
 **/
int r_misc_loadfile(char* filename, char** buffer, uint32_t* size);

/**
 * \brief Return a number greater than or equal to #min, which is a power of
 * 2. The returned number will be at least 8.
 **/
uint32_t r_misc_power2(uint32_t min);

#endif /* R_MISC_H */
